<?php
namespace App\Facades;

use Illuminate\Support\Facades\Facade;

/**
 * 微信APP开发插件
 * @package App\Services
 */
class EasyWechat extends Facade
{
    /**
     * 默认为 Server.
     *
     * @return string
     */
    public static function getFacadeAccessor()
    {
        return 'wechat.official_account';
    }

    /**
     * @return \EasyWeChat\OfficialAccount\Application
     */
    public static function officialAccount($appid = '')
    {
        return $appid ? app('wechat.official_account.'.$appid) : app('wechat.official_account');
    }

    /**
     * @return \EasyWeChat\Work\Application
     */
    public static function work($appid = '')
    {
        return $appid ? app('wechat.work.'.$appid) : app('wechat.work');
    }

    /**
     * @return \EasyWeChat\Payment\Application
     */
    public static function payment($appid = '')
    {
        return $appid ? app('wechat.payment.'.$appid) : app('wechat.payment');
    }

    /**
     * @return \EasyWeChat\MiniProgram\Application
     */
    public static function miniProgram($appid = '')
    {
        return $appid ? app('wechat.mini_program.'.$appid) : app('wechat.mini_program');
    }

    /**
     * @return \EasyWeChat\OpenPlatform\Application
     */
    public static function openPlatform($appid = '')
    {
        return $appid ? app('wechat.open_platform.'.$appid) : app('wechat.open_platform');
    }
}